package com.item.service;

import com.item.dao.MediaFileMapper;
import com.item.dao.model.MediaFile;
import com.item.dao.model.MediaFileExample;
import com.item.daoEx.MediaFileMapperEx;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MediaFileService {
    @Autowired
    private MediaFileMapper mediaFileMapper;
    
    @Autowired
    private MediaFileMapperEx mediaFileMapperEx;

    private static final Logger logger = Logger.getLogger(MediaFileService.class);

    public int countByExample(MediaFileExample example) {
        return this.mediaFileMapper.countByExample(example);
    }

    public MediaFile selectByPrimaryKey(String fileId) {
        return this.mediaFileMapper.selectByPrimaryKey(fileId);
    }

    public List<MediaFile> selectByExample(MediaFileExample example) {
        return this.mediaFileMapper.selectByExample(example);
    }

    public int deleteByPrimaryKey(String fileId) {
        return this.mediaFileMapper.deleteByPrimaryKey(fileId);
    }

    public int updateByPrimaryKeySelective(MediaFile record) {
        return this.mediaFileMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(MediaFile record) {
        return this.mediaFileMapper.updateByPrimaryKey(record);
    }

    public int deleteByExample(MediaFileExample example) {
        return this.mediaFileMapper.deleteByExample(example);
    }

    public int updateByExampleSelective(MediaFile record, MediaFileExample example) {
        return this.mediaFileMapper.updateByExampleSelective(record, example);
    }

    public int updateByExample(MediaFile record, MediaFileExample example) {
        return this.mediaFileMapper.updateByExample(record, example);
    }

    public int insert(MediaFile record) {
        return this.mediaFileMapper.insert(record);
    }

    public int insertSelective(MediaFile record) {
        return this.mediaFileMapper.insertSelective(record);
    }
    
    public int addDownloadTimes(MediaFile file){
    	return this.mediaFileMapperEx.addDownloadTimes(file);
    }
    
    public List<MediaFile> getMediaFIlesByName(MediaFile file){
    	return this.mediaFileMapperEx.getMediaFIlesByName(file);
    }
}